{#
  @typedef {string} url - The url for the prerendering.
#}
{% macro prerender(url) %}
{% if url and not url.startsWith('http://') and not url.startsWith('https://') %}
{% set speculationRules %}
{
  "prerender":[
    {
      "source":"list",
      "urls":[
        "{{ url }}"
      ]
    }
  ]
}
{% endset %}
<script type="speculationRules">{{ speculationRules | minifyJSON | cspHash | safe }}</script>
{% endif %}
{% endmacro %}
